import { FormSchema } from '@/components/Table';

export const searchFormSchema: FormSchema[] = [
  {
    field: 'guild_id',
    label: 'guild_id',
    component: 'Input',
    colProps: { span: 5 },
  },
  {
    field: 'tasks',
    label: 'task_id',
    component: 'Input',
    colProps: { span: 6 },
  },
];

export const caresiteFormSchema: FormSchema[] = [
  {
    field: 'title',
    label: '网站名称',
    component: 'Input',
    helpMessage: ['网站名称'],
    rules: [
      {
        required: true,
        message: '请输入网站名称',
      },
    ],
  },
  {
    field: 'URL',
    label: '网站地址',
    component: 'Input',
    helpMessage: ['网站地址'],
    rules: [
      {
        required: true,
        message: '请输入网站地址',
      },
    ],
  },
  {
    field: 'mode',
    label: '网站浏览模式',
    component: 'Select',
    componentProps: {
      options: [
        { label: '手机端', value: 0 },
        { label: '电脑端', value: 1 },
      ],
    },
    defaultValue: 0,
    helpMessage: ['使用手机或电脑模式查看网站'],
    rules: [
      {
        required: true,
        message: '请输入元素选择器',
      },
    ],
  },
  {
    field: 'selectorType',
    label: '选择器类型',
    component: 'Select',
    helpMessage: ['选择器类型'],
    componentProps: {
      options: [
        { label: 'css选择器', value: 'css' },
        { label: 'xpath选择器', value: 'xpath' },
      ],
    },
    defaultValue: 'css',
    rules: [
      {
        required: false,
        message: '请输入网站地址',
      },
    ],
  },
  {
    field: 'selector',
    label: '选择器',
    component: 'Input',
    helpMessage: ['选择器'],
    rules: [
      {
        required: false,
        message: '请输入网站地址',
      },
    ],
  },
  {
    field: 'xpath',
    label: 'xpath选择器',
    component: 'Input',
    helpMessage: ['复制XPaht选择器，用于检查网站是否存在新内容'],
    rules: [
      {
        required: false,
        message: '请输入元素选择器',
      },
    ],
  },
];
